<template>
	<s-table
		ref="tableRef"
		:columns="columns"
		:data="loadData"
		:row-key="(record) => record.id"
		:scroll="{ x: 'max-content' }"
		:size="5"
		:pageSizeOptions="['5', '10', '20']"
	>
	</s-table>
</template>

<script setup name="allocate">
import allocateApi from '@/api/tjzy/allocate/allocateApi'

const props = defineProps({
	batchNumber: String,
	debtorCardId: String
})
const searchFormState = ref({
	current: 1,
	size: 5,
	batchNumber: props.batchNumber,
	debtorCardId: props.debtorCardId
})
const tableRef = ref()
const columns = [
	{
		title: '类型',
		dataIndex: 'typeName'
	}, {
		title: '调解员',
		dataIndex: 'mediatorName'
	},
	{
		title: '操作人',
		dataIndex: 'createUserName'
	},
	{
		title: '操作时间',
		dataIndex: 'createTime'
	}
]
const loadData = (parameter) => {
	searchFormState.value.current = parameter.current
	return allocateApi.allocatePage(searchFormState.value).then((res) => {
		return res
	})
}
onMounted(() => {
	tableRef.value.refresh(true)
})
</script>
